package com.boot.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.stereotype.Component;

@Component
public class SpringUtils implements ApplicationListener<ContextRefreshedEvent> {
    public static ApplicationContext ctx;

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        ctx = event.getApplicationContext();
    }
}
